package com.example.spring_mybatis.controller;

import com.example.spring_mybatis.entity.User;
import com.example.spring_mybatis.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author onoo
 * @create 2021-08-15
 **/
@RestController
@RequestMapping
public class UserController {

    @Autowired
    private UserMapper userMapper;

    @RequestMapping("/i")
    public String insert(String name){
        User user = new User ();
        user.setName (name);
        userMapper.insert (user);
        return "ok";
    }

}
